import config from "@/config"
import http from "@/utils/request"

export default {
	getAllSettlementMethod: {
		url: `${config.API_URL}/adminapi/config/getAllSettlementMethod`,
		name: "获取结算方式",
		get: async function(){
			return await http.get(this.url);
		}
	},
	getAllSubject: {
		url: `${config.API_URL}/adminapi/config/getSubjectList`,
		name: "获取所有科目",
		get: async function(){
			return await http.get(this.url);
		}
	},
	getStudentGradeList: {
		url: `${config.API_URL}/adminapi/config/getStudentGradeList`,
		name: "获取所有年级",
		get: async function(){
			return await http.get(this.url);
		}
	},
	getConfig: {
		url: `${config.API_URL}/adminapi/config/getConfig`,
		name: "获取配置信息",
		get: async function(){
			return await http.get(this.url);
		}
	},
	upload: {
		url: `${config.API_URL}/adminapi/upload/image`,
		name: "文件上传",
		post: async function(data, config={}){
			return await http.post(this.url, data, config);
		}
	},
    uploadFile: {
		url: `${config.API_URL}/adminapi/upload/file`,
		name: "附件资料",
		post: async function(data, config={}){
			return await http.post(this.url, data, config);
		}
	},
	// uploadFile: {
	// 	url: `${config.API_URL}/uploadFile`,
	// 	name: "附件上传",
	// 	post: async function(data, config={}){
	// 		return await http.post(this.url, data, config);
	// 	}
	// },
	exportFile: {
		url: `${config.API_URL}/fileExport`,
		name: "导出附件",
		get: async function(data, config={}){
			return await http.get(this.url, data, config);
		}
	},
	importFile: {
		url: `${config.API_URL}/fileImport`,
		name: "导入附件",
		post: async function(data, config={}){
			return await http.post(this.url, data, config);
		}
	},
	file: {
		menu: {
			url: `${config.API_URL}/file/menu`,
			name: "获取文件分类",
			get: async function(){
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/file/list`,
			name: "获取文件列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	}
}
